package com.tongji.seller.command
{
	import com.tongji.seller.events.AddStoreItemEvent;
	import com.tongji.seller.model.StoreProductModel;
	import com.tongji.seller.service.StoreProductService;
	
	import org.robotlegs.mvcs.Command;

	/**
	 * 
	 * @author caddy
	 * 
	 */	
	public class AddStoreItemCommand extends Command
	{
		[Inject]
		public var event:AddStoreItemEvent;
		
		[Inject]
		public var service:StoreProductService;
		
		[Inject]
		public var model:StoreProductModel;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case AddStoreItemEvent.ADD_STORE_ITEM:
				{
					service.addStoreItemImgInfo(event.productId, event.userId, event.sImg);
					break;
				}
				case AddStoreItemEvent.ADD_STORE_ITEM_INFO_LIST:
					service.addStoreItemInfo(event.prc_url);
					break;
				case AddStoreItemEvent.GET_ITEMID:
					//model.productID = event.productId;
					break;
				default:
				{
					break;
				}
			}
			
		}
		
	}
}